#! /usr/bin/python

class sketchitSerial :
    def __init__( self ):
        pass
    Pattern = 0
    def display( self, serport ):
            x = serport.readline()
            print "Reading Serial Port"
            if x[:7] == 'Synched':
                print "Synched player" + x[-1] + "\n"
            if x[:7] == 'Maximum':
                print "Maximum of 4 players synched"
            if x[:8] == 'Gameplay':
                if x[-1] == '0':
                    print "Gameplay selected: 2 player Competitive"
                    GamePlay = 0
                if x[-1] == '1':
                    print "Gameplay selected: 2 player Cooperative"
                    GamePlay = 1
                if x[-1] == '2':
                    print "Gameplay selected: 3 player Cooperative"
                    GamePlay = 2
                if x[-1] == '3':
                    print "Gameplay selected: 4 player Cooperative"
                    GamePlay = 3
                if x[-1] == '4':
                    print "Gameplay selected: 4 player Competitive - Node 1 and Node 2 are team A, Node 3 and Node 4 are team B"
                    GamePlay = 4
            if x[:7] == 'Players':
                    Players = x
            if x[:5] == 'Start':
                GameStarted = True
            if x[:7] == 'Pattern':
                if x[-1] == '0':
                    print Pattern
                    Pattern = 0
                if x[-1] == '1':
                    Pattern = 1
                if x[-1] == '2':
                    Pattern = 2
                if x[-1] == '3':
                    Pattern = 3
            if x[:8] == 'Gameover':
                GameOver = True
            if x[:6] == 'Scores':
                printScores = True
                Scores = x
            if x[:5] == 'Reset':
                Reset = True

